<template>
	<view>
		<view class="pigHouse animated bounceInLeft slow" v-for="(item,index) in disintionList" :key="index">
			<view class="head">
				<view style="margin-top: 45rpx;">
					<text style="border-left: #07D188 solid 12rpx; padding-left: 20rpx; font-weight: bold;">养殖仓：{{item.warehouse_name}}</text>
				</view>
				<view style="height: 100rpx; width: auto;">
					<image src="../../static/rear/pigstyAndHouse/editer.png" @click="goEditor(index)" style="height: 52rpx; width: 52rpx; padding-bottom: 10rpx; padding-top: 10rpx; padding-left: 10rpx; padding-right: 10rpx;" mode="aspectFit"></image>
				</view>
			</view>
			<view class="footer">
				<view class="houseLeft">
					<image src="../../static/rear/feedManagement/timg1.jpg" mode="scaleToFill"/>
				</view>
				<view class="houseRight">
					<view style="display: flex; flex-wrap: wrap; justify-content: flex-start; width: 335rpx;">
						
						<text style="font-weight: 300;">消毒情况：</text>
						
						<!-- <picker class="width-100" :range="feed" :value="pickerIndex" @change="feedDateChange">
							<view class="xiala1">
								{{feed[pickerIndex]}}&nbsp;▼
							</view>
						</picker> -->
						<text style="width: 180rpx; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">{{item.disinfection_remarks}}</text>
					</view>
					
					<view style="display: flex; flex-wrap: wrap; justify-content: flex-start; width: 335rpx;">
						<text style="font-weight: 300;">消毒品：</text>
						<text style="width: 180rpx; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">{{item.disinfection_name}}</text>
					</view>
					
					<view style="display: flex; flex-wrap: wrap; justify-content: space-between; width: 335rpx;">
						<text style="font-weight: 300;">使用量：</text>
						<view style="width: 150rpx; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">
							<text>{{item.disinfection_number}}</text>
						</view>
						<text style="width: 30rpx; white-space:nowrap;">KG</text>
					</view>
				</view>
			</view>
			<view class="remarks">
				<view>
					<text>创建人</text>
					<text>{{item.disinfection_creation_user_id}}</text>
				</view>
				<view>
					<text>创建时间</text>
					<text>{{item.disinfection_creation_time}}</text>
				</view>
				<view>
					<text>消毒人员</text>
					<text>{{item.disinfection_modifier_user_id}}</text>
				</view>
				<view>
					<text>消毒时间</text>
					<text>{{item.disinfection_modification_time}}</text>
				</view>
				<view>
					<text>消毒人员联系方式</text>
					<text>{{item.disinfection_phone}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data () {
			return {
				index: 0,
				pickerIndex: 0,
				editor_disinfection_remarks: '',//消毒情况
				editor_disinfection_name: '',//消毒品
				editor_disinfection_number: '',//使用量
				editor_disinfection_phone: '',//联系方式
				editor_disinfection_id: '',//消毒id
			}
		},
		props: {
			disintionList: {
				type: Array
			},
			person: {
				type: String
			}
		},
		methods: {
			//pikey选择器赋值
			feedDateChange: function(e) {
				this.pickerIndex = e.target.value
				console.log(this.pickerIndex)
			},
			
			//跳转编辑页
			goEditor (index) {
				if(this.$props.person == 'livestock'){
					this.editor_disinfection_remarks = this.$props.disintionList[index].disinfection_remarks
					this.editor_disinfection_name = this.$props.disintionList[index].disinfection_name
					this.editor_disinfection_number = this.$props.disintionList[index].disinfection_number
					this.editor_disinfection_phone = this.$props.disintionList[index].disinfection_phone
					this.editor_disinfection_id = this.$props.disintionList[index].disinfection_id
					console.log(this.editor_disinfection_remarks,this.editor_disinfection_name,this.editor_disinfection_number,this.editor_disinfection_phone,this.editor_disinfection_id)
					
					uni.navigateTo({
						url: './disinfection_editor'+ 
							'?editor_disinfection_remarks=' +this.editor_disinfection_remarks +
							'&editor_disinfection_name=' + this.editor_disinfection_name +
							'&editor_disinfection_number=' + this.editor_disinfection_number +
							'&editor_disinfection_phone=' + this.editor_disinfection_phone+
							'&editor_disinfection_id=' + this.editor_disinfection_id
					})
				}else{
					uni.showToast({
						title: "您不能进行此操作哦!",
						icon: "none"
					})
				}
			}
		}
	}
</script>

<style lang="less">
	.pigHouse {
		width: 710rpx;
		height: auto;
		display: flex;
		flex-direction: column;
		border-radius: 40rpx;
		margin: 20rpx 20rpx 40rpx;
		box-shadow: 0rpx 0rpx 10rpx 5rpx #C0C0C0;
	}
	.head {
		display: flex;
		flex-wrap: wrap;
		height: auto;
		justify-content: space-between;
		width: 640rpx;
		border-bottom: solid 2rpx #E3E3E3;
		margin-left: 40rpx;
		padding-bottom: 20rpx;
	}
	.footer {
		display: flex;
		flex-wrap: wrap;
		margin-top: 20rpx;
	}
	.houseLeft {
		width: 355rpx;
		height: 360rpx;
		text-align: center;
	}
	image {
		width: 280rpx;
		height: 280rpx;
		margin-top: 40rpx;
		border-radius: 30rpx;
	}
	.houseRight {
		width: 335rpx;
		height: 260rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: center;
		padding-top: 45rpx;
		padding-bottom: 20rpx;
		font-size: 32rpx;
	}
	
	.remarks {
		display: flex;
		flex-direction: column;
	}
	.remarks>view {
		display: flex; 
		flex-wrap: wrap; 
		justify-content: 
		space-between; 
		margin-left: 40rpx; 
		margin-right: 40rpx; 
		font-size: 30rpx; 
		color: #808080;
		margin-top: 20rpx;
		margin-bottom: 20rpx;
	}
	
	.xiala1 {
		width: 140rpx;
		border: #bfbfbf 1upx solid;
		font-size: 32upx;
		text-align: center;
		color: #000000;
	}
</style>
